MacPLL is a program for electronics engineers, students and hobbyist. It simplifies calculation of loop filters for second-order phase-locked loops. It’s useful for designing synthesizers, clock recovery systems, demodulators, etc. After program launched, it presents window with block-diagram of a PLL loop. All changeable parameters either located on the block-diagram or next to it.
Operation of the program of it should be self-explanatory for anyone who knows what PLL is. The calculation is based on transient response of PLL, NOT it’s spectral or phase response. Since spectral purity and phase noise depends on many factors, including such as charge pump leakage current (input current offset for Op-Amp), and many others, it’s not calculated in this program.
You can have more then one window with different PLL parameters open. Number of windows depends on memory given to MacPLL. It uses about 30-40kb of RAM per window. You can not save the results or print them out.
When MacPLL launched, it fills in certain parameters, such as dumping factor, response time and error, and reference generator divider ratio to default values. I selected those values as most commonly used (in my opinion). You can change them, but they wouldn’t stay between restarts of the MacPLL. All other parameters are left blank and have to be filled in by you. If you forget to enter some data, MacPLL will beep and display red question mark where data is missing. MacPLL will do some limited checking on input data. If it thinks that data is invalid, it’ll display same red question mark near that data. The reference frequency divider ratio can be integer only, and you will not be allowed to enter anything else.
MacPLL will do some limited checking on output data. If it encounters problems, the output data that is questionable will have red cross next to it, as indicator that it’s unreliable.
MacPLL calculates resistors and capacitors for 4 types of loop filters - passive integrator, passive lead-lag, active lead-lag and active integrator. As you select different filter in pop-up menu, different schematic will appear. MacPLL will also calculate capacitance for additional pole that might be used in the filter. The filter schematic is provided with correcting capacitor. If you don’t want it, it could be safely thrown away, and 2 resistors in series can be replaced with 1 of twice higher resistance. Calculated values can be used with other type filters, such as with transistor and charge pump in Motorolla’s MC4044 phase detector. MacPLL does not perform any checks to see if calculated values are realizable and can be used in particular filter configuration. It is up to you to make sure that it makes sense.
MacPLL uses 4 different types of phase detectors - analog, XOR, master-slave edge triggered JK trigger and phase-frequency sensitive phase detectors. Same as with loop filter schematic, it will change to appropriate type when you select it in pop-up menu.
Besides calculating filter parameters, MacPLL will also find some other parameters of the PLL: Pull-in, Pull-out, Lock-in and Hold Frequency ranges, Natural Loop Frequency, -3db Loop Bandwidth, maximum overshoot and loop divider ratios. It will also calculates VCO range needed to handle required overshoot.
Things to be aware of:
While I’m not going to get into details of how PLL is calculated, there few things that users should be aware of:
1.When synthesizer is calculated, the damping factor, natural frequency and everything else used as a basis of the calculation is found for the center frequency of the synthesizer.
2. Maximum overshoot and all dynamic parameters are found for center frequency also. They might be quite different on the edges of the frequency range.
3. Maximum damping factor IS the maximum. E.g it is found for highest frequency of the synthesizer.
4. Feedback divider ratios are rounded to lowest integer for Nmin and to highest integer for Nmax. There are no checking to see if frequency step and VCO ranges coincide - if you want frequency step of 100KHz and give VCO range of 1.01 to 1.05MHz, MacPLL will not flag it as an error.
5. If you make range of synthesizer too great to be realized with single loop filter/VCO, MacPLL will still not complain. Make sure you ask it to do reasonable things if you want to get reasonable results!
6. The correcting capacitor Cc is calculated based on Cc = 0.8/(OmegaN*R1). This provides decent sidebands and transient suppression. This is not the only way to determine the Cc. Another way (one of many) might be Cc=(R2*C)/(5*R1), depending on what you want. Usually you want OmegaC (additional pole location) to be about 5 time OmegaN (natural loop frequency) The additional sideband suppression can be calculated as:
SBdb = n*20Log(OmegaC/OmegaRef),
where
n - number of poles (=2);
OmegaC - frequency of the correcting pole;
OmegaRef - Reference frequency (at the phase detector).
7. For some of the filter configurations shown, it might be very inappropriate to use Cc. For some others (not shown) it needed to be calculated differently. MacPLL will not give you any warning in such case. Make sure you understand what you are doing before doing it.
8. Not all calculated values of R1 and R2 are realizable or should be used with all type of filters. Warning in p.7 applies to this one as well.
Source code:
Source code for MacPLL is provided. It can be used freely for any noncommercial or in-house development. For any commercial development, my permission must be obtained first. I, most likely, will only ask you to put my name in credits and give me full version of your software. If you write something noncommercial and want to distribute it, please send me a copy and give me a credit in appropriate place.
MacPLL is written in C++ using Metrowerks CodeWarrior10 and PowerPlant. For obvious reasons, source code for PowerPlant and libraries from Metrowerks are not distributed with MacPLL.
The code is reasonably well commented (at least I think so). I’ll be happy to answer any questions, but it might take me a while, so don’t count to instant reply.
The equations used in MacPLL are well known and can be found in many books about PLL and control theory. Examine source code to understand what’s going on, and read my comments. Neither this manual no program itself are intended as substitute for knowledge of phase-locked loops, so if you having troubles understanding what’s going on, I recommend read about them first.
Systems Supported:
MacPLL should work on any Mac and Pmac with systems 7.5 and up. It also might work on Sys 7.1, but I never tested it. It might be pretty slow on 68000 computers. For example, it takes 4 seconds on 68040, 20 seconds on 68030 (Iisi), 1 second on PMac (in emulation) and unnoticeable on Pmac under native code. It needs at least 680x480 monitor.
Legal Info:
MacPLL is free for noncommercial use. For any other use, it’s $5.00 US. It can be distributed freely provided it is not modified in any way and whole package, including this manual and source codes is distributed together with it. Organizations that charge anything except normal download charges for distribution have to get my written permission before distributing MacPLL. It can be distributed on Info-Mac CD.
The source code is included as part of distribution. It can be used freely for any in-house development or any noncommercial use. If software based on this source code distributed, my name should be credited in appropriate place, and copy of the software sent to me. If source code used to create commercial software, my written permission must be obtained first.
This software is provided "as is" and you, the user, are assuming full responsibility for its use and the entire risk as to its quality and performance. In no event will I be responsible for any damages, direct or consequential to your data, computer, hard drive, business, hardware product, etc. You, the user, must determine suitability of this software for your application and correctness of it’s results.
The software is believed to be bug-free. It has been tested on PMac 7500/100, Pmac 7200/90, Mac Iisi, Mac Iisi with 68040 accelerator. It is 32-bit clean and should be able to work with virtual memory. Bug reports and suggestions are welcome, although it might be a while before I get around to fixing it.
All names are trademarks or registered trademarks of their respective owners.